cmake_minimum_required(VERSION 3.14)

project(fructrl)
set(TARGET_LIB ${PROJECT_NAME})
set(BUILD_DIR temp)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

set(APP_INSTALL_DIR opt/bmc/apps/${PROJECT_NAME})
set(LUACLIB_INSTALL_DIR ${APP_INSTALL_DIR}/luaclib)

if(BUILD_MANUFACTURE)
    install(DIRECTORY manufacture/ DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
endif()
install(DIRECTORY src/lualib DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
install(DIRECTORY include/ DESTINATION opt/bmc/lualib OPTIONAL)
install(DIRECTORY src/service DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
install(DIRECTORY gen/${PROJECT_NAME}/ DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
install(DIRECTORY gen/class DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
install(FILES mds/schema.json DESTINATION ${APP_INSTALL_DIR}/mds OPTIONAL)
install(FILES mds/service.json DESTINATION ${APP_INSTALL_DIR}/mds OPTIONAL)
install(FILES mds/factory.json DESTINATION ${APP_INSTALL_DIR}/mds OPTIONAL)
install(DIRECTORY dist/user_conf/rootfs/ DESTINATION . USE_SOURCE_PERMISSIONS OPTIONAL)
install(FILES dist/config.cfg DESTINATION ${APP_INSTALL_DIR} OPTIONAL)
